<tpl var layoutBody={ />
<div data-identity="${{info.identity}}:${{info.key}}" data-table="${{info.table}}">
	<div class="layui-breadcrumb">
		<a href="/admin/index.jspx">首页</a>
		<a href="/admin/${{info.path}}/${{info.key}}/index.jspx">${{info.name}}</a>
		<a href="javascript:;"> <cite>添加</cite></a>
	</div>
	<hr>
	<fieldset class="layui-elem-field">
		<legend>添加 ${{info.name}}</legend>
		<div class="layui-field-box">
			<form class="layui-form" action="save.json?oper=create" lay-filter="m${{info.tableName}}Form">
				<% for(item in createList){ %>
				<div class="layui-form-item" data-type="${{item.type}}" data-isnull="${{item.isnull}}" data-name="${{item.name}}">
					<label class="layui-form-label">${{item.comment}}：</label>
					<div class="layui-input-block">
						<input type="text" name="${{item.feild}}" placeholder="请输入${{item.comment}}" autocomplete="off" class="layui-input">
					</div>
				</div>
				<% } %>
				<div class="layui-form-item">
					<div class="layui-input-block">
						<button class="layui-btn" lay-submit lay-filter="m${{info.tableName}}Form">立即提交</button>
					</div>
				</div>
			</form>
		</div>
	</fieldset>
</div>
<tpl }; />

<tpl var layoutScript={ />
<script>
	layui.use([ 'element', 'form' ], function() {
		// 绑定表单提交事件
		layui.form.on('submit(m${{info.tableName}}Form)', function(data) {
			$.postLoading('save.json?oper=create', data.field, function(res) {
				layer.msg(res.message, {
					icon: 1,
					time: 1500
				}, function () {
					history.back();
				});
			});

			return false;
		});
	});
</script>
<tpl }; />
<tpl include( "../../tpl/layout-scroll.html",{identity:"${{info.identity}}:${{info.key}}",layoutBody:layoutBody,layoutScript:layoutScript}){}/>